import { createRouter, createWebHistory } from 'vue-router'
// import Home from '../views/Home.vue'

const routes = [
  {          // 登录
    path: '/',
    name: 'login',
    component: function () {
      return import('../views/order_takeout/login.vue')
    }
  },

  {        // 注册
    path: '/register',
    name: 'register',
    component: function () {
      return import('../views/order_takeout/register.vue')
    }
  },

  {       //项目主页
    path: '/home',
    name: 'home',
    component: function () {
      return import('../views/order_takeout/home.vue')
    }
  },

  {     //商家主页
    path: '/shops_home',
    name: 'shops_home',
    component: function () {
      return import('../views/shops/shops_home.vue')
    }
  },
  {     //修改商家信息页面
    path: '/update_shops',
    name: 'update_shops',
    component: function () {
      return import('../views/shops/update_shops.vue')
    }
  },

  {     //商家的详细信息
    path: '/shops_list',
    name: 'shops_list',
    component: function () {
      return import('../views/order_takeout/shops_list.vue')
    }
  },
  
  { //购物车页面 
    path: '/cartfull',
    name: 'cartfull',
    component: function () {
      return import('../views/order_takeout/cartfull.vue')
    }
  },
  {  //用户信息页面
    path: '/user',
    name: 'user',
    component: function () {
      return import('../views/user/user.vue')
    }
  },
  {  //订单页面
    path: '/order',
    name: 'order',
    component: function () {
      return import('../views/order_takeout/order.vue')
    }
  },
  {  //回调页面
    path: '/pay_callback',
    name: 'pay_callback',
    component: function () {
      return import('../views/order_takeout/pay_callback.vue')
    }
  },
  {  //评论页面
    path: '/comment',
    name: 'comment',
    component: function () {
      return import('../views/comment/comment.vue')
    }
  },
  {  //评论页面
    path: '/asd',
    name: 'asd',
    component: function () {
      return import('../views/comment/asd.vue')
    }
  },
  {  //商家订单页面
    path: '/shops_order',
    name: 'shops_order',
    component: function () {
      return import('../views/shops/shops_order.vue')
    }
  },
  {  //聊天页面
    path: '/user_chat',
    name: 'user_chat',
    component: function () {
      return import('../views/chat/user_chat.vue')
    }
  },
  {  //聊天页面
    path: '/shop_chat',
    name: 'shop_chat',
    component: function () {
      return import('../views/chat/shop_chat.vue')
    }
  },


  //爬虫
  {     //修改商家信息页面
    path: '/pachong',
    name: 'pachong',
    component: function () {
      return import('../views/pachong/pacong.vue')
    }
  },

  // {
  //   path: '/user_all',
  //   // path: '/',
  //   name: 'user_all',
  //   component: function () {
  //     return import('../views/day1/users_show.vue')
  //   }
  // }






  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: function () {
  //     return import(/* webpackChunkName: "about" */ '../views/About.vue')
  //   }
  // }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
